package com.zhuhjay.common.web.model.domain;

import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

/**
 * @author ZhuHJay
 * @date 2023/7/15 10:49
 */
@Data
public class CursorReq {

    /**
     * 游标: 初始可为null
     */
    private String cursor;
    /**
     * 页长度
     */
    @Min(1)
    @Max(50)
    private Integer size = 10;

    @JsonIgnore
    public boolean hasCursor() {
        return StrUtil.isNotBlank(cursor);
    }

}
